package com.contest.quartz.data;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * 
 *
 * @title: ScheduleJob.java
 * @package cn.jeeweb.core.quartz.domain
 * @description: 计划任务信息
 * @copyright: 2017 www.jeeweb.cn Inc. All rights reserved.
 *
 */
@SuppressWarnings("serial")
public class ScheduleJob implements Serializable
{

	public static final String STATUS_RUNNING = "1";
	public static final String STATUS_NOT_RUNNING = "0";
	public static final String CONCURRENT_IS = "1";
	public static final String CONCURRENT_NOT = "0";


	
	@Override
	public String toString()
	{
		return ToStringBuilder.reflectionToString(this);
	}


	public final static String JOB_NAME ="jobName";
	public final static String JOB_GROUP ="jobGroup";
	public final static String JOB_STATUS ="jobStatus";
	public final static String CRON_EXPRESSION ="cronExpression";
	public final static String DESCRIPTION ="description";
	public final static String BEAN_CLASS ="beanClass";
	public final static String IS_CONCURRENT ="isConcurrent";
	public final static String SPRING_ID ="springId";
	public final static String METHOD_NAME ="methodName";
   
    private Integer id;

	/**
	 * trigger 类型
	 */
	private String triggerType;

	/**
	 * 执行规则说明
	 */
	private String runRuleComment;
	/**
	 * 任务名称
	 */
	private String jobName;
	/**
	 * 任务分组
	 */
	private String jobGroup;
	/**
	 * 任务状态 是否启动任务
	 */
	private String jobStatus;
	/**
	 * cron表达式
	 */
	private String cronExpression;
	/**
	 * 描述
	 */
	private String description;
	/**
	 * 任务执行时调用哪个类的方法 包名+类名
	 */
	private String beanClass;
	/**
	 * 任务是否有状态
	 */
	private String isConcurrent = CONCURRENT_NOT;

	/**
	 * Spring bean
	 */
	private String springId;

	/**
	 * 任务调用的方法名
	 */
	private String methodName;

	/**
	 * 要携带数据
	 */
	private  Map dataMap;


	public String getRunRuleComment() {
		return runRuleComment;
	}

	public void setRunRuleComment(String runRuleComment) {
		this.runRuleComment = runRuleComment;
	}

	public String getTriggerType() {
		return triggerType;
	}

	public void setTriggerType(String triggerType) {
		this.triggerType = triggerType;
	}

	public Map getDataMap() {
		if(dataMap == null)
		{
			dataMap = new HashMap();
		}
		return dataMap;
	}

	public void setDataMap(Map dataMap) {
		this.dataMap = dataMap;
	}


	public Integer getId()
	{
		return id;
	}

	public void setId(Integer id)
	{
		this.id = id;
	}

	public String getJobName()
	{
		return jobName;
	}

	public void setJobName(String jobName)
	{
		this.jobName = jobName;
	}

	public String getJobGroup()
	{
		return jobGroup;
	}

	public void setJobGroup(String jobGroup)
	{
		this.jobGroup = jobGroup;
	}

	public String getJobStatus()
	{
		return jobStatus;
	}

	public void setJobStatus(String jobStatus)
	{
		this.jobStatus = jobStatus;
	}

	public String getCronExpression()
	{
		return cronExpression;
	}

	public void setCronExpression(String cronExpression)
	{
		this.cronExpression = cronExpression;
	}

	public String getDescription()
	{
		return description;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	public String getBeanClass()
	{
		return beanClass;
	}

	public void setBeanClass(String beanClass)
	{
		this.beanClass = beanClass;
	}

	public String getIsConcurrent()
	{
		return isConcurrent;
	}

	public void setIsConcurrent(String isConcurrent)
	{
		this.isConcurrent = isConcurrent;
	}

	public String getMethodName()
	{
		return methodName;
	}

	public void setMethodName(String methodName)
	{
		this.methodName = methodName;
	}

	public String getSpringId()
	{
		return springId;
	}

	public void setSpringId(String springId)
	{
		this.springId = springId;
	}

}